package com.corticon.dialogs.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;


/**
 * PublicationStatusType entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "qs_publicationstatustype")
public class PublicationStatusType implements java.io.Serializable {
    public enum BasicType {
        inprocess, published, retired
    }

    // Fields
    private String code;
    private String description;
    private String name;
    private Set<Questionnaire> questionnaires = new HashSet<Questionnaire>();

    public PublicationStatusType() {
    }

    // Property accessors
    @GenericGenerator(name = "generator", strategy = "uuid.hex")
    @Id
    @GeneratedValue(generator = "generator")
    @Column(name = "code",  nullable = false, length = 256)
    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Column(name = "description", length = 256)
    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Column(name = "name", length = 256)
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @OneToMany(mappedBy = "publicationStatus")
    public Set<Questionnaire> getQuestionnaires() {
        return this.questionnaires;
    }

    public void setQuestionnaires(Set<Questionnaire> questionnaires) {
        this.questionnaires = questionnaires;
    }
}